﻿using D.UtilCore;
using D.UtilCore.Dtos;
using D.UtilCore.Filters;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using CozeDto.TenantsDtos;
using CozeDomain.IServices;
using D.UtilFreesqlOrm;

namespace CozeWapApi
{
    /// <summary>
    /// 多站点租户模块
    /// </summary>
    [Route("/api/[controller]/[action]")]
    [Authorize]
    public class TenantsController : BaseApiController
    {
        private readonly ITenantsService _tenantsService;
        public TenantsController(ITenantsService tenantsService)
        {
            _tenantsService = tenantsService;
        }

        
        /// <summary>
        /// 获取详情
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        [HttpGet("{domain}"), TypeFilter(typeof(ExtActionFilterAttribute))]
        [Authorize]
        public async Task<ApiResult<RepNoticeDetail>> Get(string? domain)
        { 
            return await _tenantsService.GetTenantsNoticeAsync(domain);
        }
    }
}
